<template>
  <scTable
    ref="table"
    :apiObj="apiObj"
    :params="params"
    row-key="id"
    stripe
    hideRefresh
    hideSetting
    border
  >
    <el-table-column
      label="借款名称"
      prop="loanName"
      min-width="250"
      :show-overflow-tooltip="true"
    ></el-table-column>
    <el-table-column
      label="借款人"
      prop="adminName"
      min-width="100"
    ></el-table-column>
    <el-table-column label="借款时间" prop="createTime" min-width="150">
    </el-table-column>
    <el-table-column label="借款金额" prop="loanMoney" min-width="100">
      <template #default="scope">
        <p>{{ scope.row.loanMoney }}元</p>
      </template>
    </el-table-column>
  </scTable>
</template>
<script>
export default {
  data () {
    return {
      apiObj: this.$API.reportForm.getLoanList,
      params: {
        time: this.$TOOL.dateFormat(new Date(), "yyyy-MM"),
      }
    }
  },
  props: {
    time: {
      type: String,
      default: ''
    }
  },
  watch: {
    time (val) {
      this.params.time = val
      this.$refs.table.refresh()
    }
  },
  methods: {
    getData () {
      this.$refs.table.refresh()
    }
  }
}
</script>